﻿<hi:common_appheader runat="server"  />
<div class="pbox">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">
                运单信息</h3>
        </div>
        <div class="panel-body">
            <div>
                物流公司：<asp:literal runat="server" id="litCompanyName" /></div>
            <div>
                运单号码：<asp:literal runat="server" id="litLogisticsNumber" /></div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        var OrderId = window.location.search;
        OrderId = OrderId.substring(OrderId.indexOf("=") + 1);
        $.ajax({
            url: "/api/VshopProcess.ashx?action=Logistic&OrderId=" + OrderId,
            type: 'POST', dataType: 'json',
            async: true,
            success: function (resultData) {
                if (resultData.message == "ok") {
                    Logstics(resultData);
                }
                else {
                    var addr = $("<div class=\"alert alert-warning alert-dismissable\"><div class=\"time font-s\"></div><div class=\"info\">" + resultData.message + "</div></div>");
                    $(".pbox").append(addr);
                }
            }
        });
    });

    function Logstics(express) {
        var perday = "";
        $(express.data).each(function (index, day) {
            if (perday != day.time.substr(0, 10)) {
                perday = day.time.substr(0, 10);
                var newdatediv = $("<p class=\"text-center\"><span class=\"label\"></span></p>");
                $(newdatediv).find("span").html(perday);
                $(".pbox").append($(newdatediv));
            }
            var addr = $("<div class=\"well active\"><div class=\"time font-s\"></div><div class=\"info\"></div></div>");
            $(addr).find("div").eq(0).html(day.time);
            $(addr).find("div").eq(1).html(day.context);
            $(".pbox").append($(addr));

        });
        $(".well:first").attr("class", "alert alert-warning alert-dismissable");
    }
</script>
<hi:common_appfooter runat="server" />
